package com.views;

import java.awt.Color;
import java.awt.Font;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

public class HomeView extends JFrame {

	JDesktopPane desktopPane;
	JMenuBar menu;
	JMenu file;
	JMenu options;
	JMenu utils;

	public JDesktopPane getDesktopPane() {
		return desktopPane;
	}

	public JMenuItem getCreateUser() {
		return createUser;
	}

	public JMenuItem getLogin() {
		return login;
	}

	public JMenuItem getForgotPassword() {
		return forgotPassword;
	}

	public JMenuItem getAdminLogin() {
		return adminLogin;
	}

	public JMenuItem getExit() {
		return exit;
	}

	public JMenuItem getCalculator() {
		return calculator;
	}

	public JMenuItem getNotepad() {
		return notepad;
	}

	JMenuItem createUser;
	JMenuItem login;
	JMenuItem exit;

	JMenuItem forgotPassword;
	JMenuItem adminLogin;

	JMenuItem calculator;
	JMenuItem notepad;

	public HomeView() {

		desktopPane = new JDesktopPane();
		menu = new JMenuBar();
		file = new JMenu("File");
		options = new JMenu("Options");
		utils = new JMenu("Utils");
		createUser = new JMenuItem("Create User         ");
		login = new JMenuItem("Login");
		exit = new JMenuItem("Exit");
		forgotPassword = new JMenuItem("Forgot Password    ");
		adminLogin = new JMenuItem("  Admin Login");
		calculator = new JMenuItem("Calculator         ");
		notepad = new JMenuItem("Notepad");

		Font menuFont = new Font("Verdana", Font.BOLD, 20);
		file.setForeground(Color.white);
		file.setFont(menuFont);
		file.setMnemonic('f');

		options.setForeground(Color.white);
		options.setFont(menuFont);
		options.setMnemonic('o');

		utils.setForeground(Color.white);
		utils.setMnemonic('u');
		utils.setFont(menuFont);

		menu.add(file);
		menu.add(options);
		menu.add(utils);

		Font menuItemFont = new Font("Verdana", Font.BOLD, 17);

		createUser.setBackground(Color.black);
		createUser.setForeground(Color.white);
		createUser.setFont(menuItemFont);
		createUser.setIcon(new ImageIcon("images/createUserImg.png"));

		login.setBackground(Color.black);
		login.setForeground(Color.white);
		login.setFont(menuItemFont);
		login.setIcon(new ImageIcon("images/userLogin.png"));

		exit.setBackground(Color.black);
		exit.setForeground(Color.white);
		exit.setFont(menuItemFont);
		exit.setIcon(new ImageIcon("images/exitImg.jpg"));

		file.add(createUser);
		file.add(login);
		file.add(exit);

		forgotPassword.setBackground(Color.black);
		forgotPassword.setFont(menuItemFont);
		forgotPassword.setForeground(Color.white);
		forgotPassword.setIcon(new ImageIcon("images/forgotPasswordImg.jpg"));

		adminLogin.setBackground(Color.black);
		adminLogin.setFont(menuItemFont);
		adminLogin.setForeground(Color.white);
		adminLogin.setIcon(new ImageIcon("images/adminLoginImg.jpg"));

		options.add(forgotPassword);
		options.add(adminLogin);

		calculator.setBackground(Color.black);
		calculator.setForeground(Color.white);
		calculator.setFont(menuItemFont);
		calculator.setIcon(new ImageIcon("images/calendarImg.jpg"));

		notepad.setBackground(Color.black);
		notepad.setFont(menuItemFont);
		notepad.setForeground(Color.white);
		notepad.setIcon(new ImageIcon("images/notepadImg.jpg"));

		utils.add(calculator);
		utils.add(notepad);

		setJMenuBar(menu);
		menu.setBackground(Color.black);
		menu.setBorder(BorderFactory.createBevelBorder(5, Color.red,
				Color.black));

		add(desktopPane);
		setVisible(true);
		setTitle("Desktop Login App");
		setExtendedState(JFrame.MAXIMIZED_BOTH);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

	}
}
